#include <iostream>
using namespace std;

class Complex{
public:
    //构造函数
    Complex(int x, int y)
    :_x(x),_y(y)
    {     }

    //输出流重载
    friend 
        ostream & operator<<(ostream & os, Complex & rhs);
    friend
        Complex & operator+=(Complex & lhs,Complex & rhs);
   
private:
    int _x;
    int _y;
};

Complex & operator+=(Complex & lhs,Complex & rhs){
    lhs._x += rhs._x;
    lhs._y += rhs._y;
    return lhs;

}


ostream & operator<<(ostream & os, Complex & rhs){
    os << "_x=" << rhs._x << " _y=" << rhs._y;
    return os;
}

void test(){
    Complex b(1,2);
    Complex c(2,3);
    b += c;
    cout << b << endl;
}

int main(int atgc, char * argv[])
{
    test();
    return 0;
}

